package com.hzzy.quartz;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.hzzy.service.HzClassCheckinsService;

@Component
public class MyJob {
	private static final Logger LOGGER = Logger.getLogger(MyJob.class);
	@Resource
	private HzClassCheckinsService hzClassCheckinsService;
	
	@Scheduled(cron="0 0 23 * * ? ")	//每天23点触发
	public void execute() {
		try {
		hzClassCheckinsService.autoInsert();
		} catch (Exception ex) {
			LOGGER.error("自动添加点到记录失败：" + ex);
		}
	}
	
}
